home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus Special 25 / AMIGAplus Sonderheft 25 (2000)(Falke)(DE)(Track 1 of 4)[!].iso / PublicDomain / Anwendungen / scrollscreen / scrollscreen.c < prev   
C/C++ Source or Header  |  1998-12-20  |  1KB  |  59 lines

  1. /*
  2.     ScrollScreen. V0.9
  3.  
  4.     Scrolls the current public screen after spesified paramaters
  5.     given via the argument. To use this program as a commodity,
  6.     use the F-key commodity from commodore.
  7.  
  8.     Made by Kjetil S. Matheussen 1998.
  9.  
  10.     Arguments are: [x] [y]. Both arguments must be spesified (important).
  11.     'x' means how many x-lines to scroll right. 'y' means how many
  12.     y-lines to scroll down.
  13.  
  14. */
  15.  
  16.  
  17.  
  18.  
  19. #include <exec/types.h>
  20. #include <intuition/intuition.h>
  21. #include <intuition/classes.h>
  22. #include <intuition/classusr.h>
  23. #include <intuition/imageclass.h>
  24. #include <intuition/gadgetclass.h>
  25. #include <libraries/gadtools.h>
  26. #include <graphics/displayinfo.h>
  27. #include <graphics/gfxbase.h>
  28. #include <clib/exec_protos.h>
  29. #include <clib/intuition_protos.h>
  30. #include <clib/gadtools_protos.h>
  31. #include <clib/graphics_protos.h>
  32. #include <clib/utility_protos.h>
  33. #include <string.h>
  34. #include <stdio.h>
  35.  
  36.  
  37. struct Screen         *Scr = NULL;
  38. UBYTE                 *PubScreenName = NULL;
  39.  
  40.  
  41. int main(int argc,char **argv){
  42.     int x,y;
  43.  
  44.     if ( ! ( Scr = LockPubScreen( PubScreenName )))
  45.         return( 1L );
  46.  
  47.     sscanf(argv[1],"%d",&x);
  48.     sscanf(argv[2],"%d",&y);
  49.  
  50.     if(y+Scr->TopEdge<0 || (Scr->TopEdge>=0 && y<0)) y=0;
  51.  
  52.     MoveScreen(Scr,-x,-y);
  53.  
  54.     UnlockPubScreen( NULL, Scr );
  55.  
  56.     return(0);
  57. }
  58.  
  59.